#import "Card.h"

@implementation Card
+ (NSString*) stringfyCardType: (Card*) c {
    switch(c->type) {
        case CLUBS:     return @"CLUBS";
        case DIAMONDS:  return @"DIAMONDS";
        case HEARTS:    return @"HEARTS";
        case SPADES:    return @"SPADES";
        case TYPE_NONE: return @"TYPE_NONE";
        default:        return @"UNKNOW";
    }
}

+ (NSString*) stringfyCardValue: (Card*) c {
    switch(c->value) {
        case ACES:  return @"ACES";
        case TWO:   return @"TWO";
        case THREE: return @"THREE";
        case FOUR:  return @"FOUR";
        case FIVE:  return @"FIVE";
        case SIX:   return @"SIX";
        case SEVEN: return @"SEVEN";
        case EIGHT: return @"EIGHT";
        case NINE:  return @"NINE";
        case TEN:   return @"TEN";
        case JACK:  return @"JACK";
        case QUEEN: return @"QUEEN";
        case KING:  return @"KING";
        case VALUE_NONE: return @"VALUE_NONE"; 
        default:         return @"UNKNOW";
    }
}

- (id) init {
    self = [super init];
    if(self) {
        self->type  = TYPE_NONE;
        self->value = VALUE_NONE;
    }

    return self;
}

- (Card*) initWithType: (int) t {
    self = [super init];
    if(self) self->type = t;

    return self;
}

- (Card*) initWithValue: (int) v {
    self = [super init];
    if(self) self->value = v;

    return self;
}
 
- (Card*) initWithType: (int) t AndValue: (int) v {
    self = [super init];
    if(self) {
        self->type  = t;
        self->value = v;
    }

    return self;
}

- (int) getCardType {
    return type;
}

- (int) getCardValue {
    return value;
}

- (void) dealloc {
    [super dealloc];
}
@end
